<?php
class Clflv
{
	public $movie;
	public $quality;
	public $allowFullScreen;
	public $FlashVars;
	public $width;
	public $height;
	public $flvName;
	public $ObjString;
	public function __construct(
	$flvName='http://localhost:90/_doll/_ae/01/01.flv', 
	$width=485, $height=365){
	    $this->__init($flvName,$width,$height);	
		$this->constructObjString();
	}
	function __init(
	$flvName='http://localhost:90/_doll/_ae/01/01.flv', 
	$width=485, $height=365 )
	{
		$this->flvName = $flvName;
		$this->movie="http://".$_SERVER[SERVER_NAME]
         .":".$_SERVER[SERVER_PORT]
          ."/_doll/_ae/".'01/vcastr.swf';
		$this->quality='high';
		$this->allowFullScreen='true';
		$this->FlashVars='vcastr_file='.$this->flvName.
		"&IsAutoPlay=1&IsContinue=1&BarPosition=0";
		$this->width=$width;
		$this->height=$height;
	}
	public function getObjString(){
	    return $this->ObjString;	
	}
	public function outHtml(){
		echo "<pre>".Clflv::sHtmlSpecialChars($this->ObjString)."</pre>";
	}
	public function export(){
	    echo $this->ObjString;	
	}
	public function constructObjString(){
		
	$this->ObjString='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" 
	width="'.$this->width.'" height="'.$this->height.'"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0">
<param name="autostart" value="1">
<param name="movie" value="'.$this->movie.'">
<param name="quality" value="'.$this->quality.'">
<param name="allowFullScreen" value="'.$this->allowFullScreen.'" />
<param name="FlashVars" 
value="'.$this->FlashVars.'" />
<embed src="'.$this->movie.'" loop="true" 
FlashVars="'.$this->FlashVars.'"
allowFullScreen="'.$this->allowFullScreen.'" quality="'.$this->quality.'" 
pluginspage="http://www.macromedia.com/go/getflashplayer"
type="application/x-shockwave-flash" width="'.$this->width.'" height="'.$this->height.'"></embed>
</object>'	;
    return $this;
		
	}
	public static function sHtmlSpecialChars($string) {
		if(is_array($string)) {
			foreach($string as $key => $val) {
				$string[$key] = Clflv::sHtmlSpecialChars($val);
			}
		} else {
		$string = str_replace
		    (
		    array('&', '"', '<', '>'), 
		    array('&amp;', '&quot;', '&lt;', '&gt;'), 
			$string
			);
		}
	    return "".$string."";
    }
	
	public function __destruct(){
		
	}
}

?>